//
//  SSDKUserInfo.m
//  SuperSDK
//
//  Created by wyht－ios－dev on 15/10/7.
//  Copyright © 2015年 WYHT. All rights reserved.
//

#import "SSDKUserInfo.h"
#import "SSDKDataKeys.h"

@implementation SSDKUserInfo

- (instancetype) initWithResData:(SSDKBaseResData *)data {
    self = [super init];
    
    if (self) {
        self.status = data.status;
        self.data = data.data;
        self.extra = data.extra;
        self.common = data.common;
    }
    
    return self;
}

- (NSString *) superSDKUid {
    return [self dataWithKey:SUPERSDK_UID];
}

- (instancetype) setSuperSDKUid : (NSString *) sUid {
    return [self setDataValue:sUid forKey:SUPERSDK_UID];
}

- (NSString *) superSDKToken {
    return [self dataWithKey:SUPERSDK_TOKEN];
}

- (instancetype) setSuperSDKToken : (NSString *) token {
    return [self setDataValue:token forKey:SUPERSDK_TOKEN];
}

- (NSString *) sdkUid {
    return [self dataWithKey:SDK_UID];
}

- (instancetype) setSdkUid : (NSString *) sdkUid {
    return [self setDataValue:sdkUid forKey:SDK_UID];
}

- (NSString *) accessToken {
    return [self dataWithKey:ACCESS_TOKEN];
}

- (instancetype) setAccessToken : (NSString *) token {
    return [self setDataValue:token forKey:ACCESS_TOKEN];
}

- (NSString *) refreshToken {
    return [self dataWithKey:REFRESH_TOKEN];
}

- (instancetype) setRefreshToken : (NSString *) token {
    return [self setDataValue:token forKey:REFRESH_TOKEN];
}

@end
